#include "GenericTypeDefs.h"
#include "cyclic_buffer.h"

#define CHUNK_BUFFER_SIZE 64

typedef struct CHUNK 
{
	BYTE	id;
	WORD	value;
	BYTE	time;
} CHUNK;

typedef union DATA_KOMBI_PACKET
{
	BYTE _byte [CHUNK_BUFFER_SIZE];
	struct
	{
		WORD 	length;
		CHUNK	data[(CHUNK_BUFFER_SIZE-sizeof(WORD))/sizeof(CHUNK)];
	};
} DATA_KOMBI_PACKET;


void chunk_buffer_init (void);

void chunk_buffer_setRLock (BOOL b);

void chunk_buffer_setWLock (BOOL b);

BOOL chunk_buffer_write (const CHUNK *pcb);

void chunk_buffer_getdata (DATA_KOMBI_PACKET *p);

